package com.example.higo.view.activity;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.widget.LinearLayout;
import android.widget.RadioGroup;

import com.example.higo.R;
import com.example.higo.persenter.homepage.HomePagePersenter;
import com.example.higo.utils.FragmentTabUtils;
import com.example.higo.view.fragment.homepage.HomePageFragment;
import com.example.higo.view.fragment.maishou.MaishouFragment;
import com.example.higo.view.fragment.message.MessageFragment;
import com.example.higo.view.fragment.my.MyFragment;
import com.example.higo.view.fragment.shishangquan.ShishangquanFragment;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;


public class MainActivity extends BaseActivity {

    @BindView(R.id.main_container_ll)
    LinearLayout mainContainerLl;
    @BindView(R.id.main_rg)
    RadioGroup mainRg;
    private HomePagePersenter persenter;
    private List<Fragment> data = new ArrayList<>();

    private HomePageFragment homePageFragment;
    private ShishangquanFragment shishangquanFragment;
    private MaishouFragment maishouFragment;
    private MessageFragment messageFragment;
    private MyFragment myFragment;

    @Override
    public int getLayoutId() {
        return R.layout.activity_main;
    }

    @Override
    public void initData() {

        homePageFragment = HomePageFragment.newInstance();
        shishangquanFragment = ShishangquanFragment.newInstance();
        maishouFragment = MaishouFragment.newInstance();
        messageFragment = MessageFragment.newInstance();
        myFragment = myFragment.newInstance();

        data.add(homePageFragment);
        data.add(shishangquanFragment);
        data.add(maishouFragment);
        data.add(messageFragment);
        data.add(myFragment);

        new FragmentTabUtils(getSupportFragmentManager(),data,R.id.main_container_ll,mainRg,new FragmentTabUtils.OnRgsExtraCheckedChangedListener(){
            @Override
            public void OnRgsExtraCheckedChanged(RadioGroup radioGroup, int checkedId, int index) {

            }
        });
    }

    @Override
    public void initView() {


    }

}
